package base.items;

import java.util.HashSet;

/**
 * The Video {@code class}. Create Video object extended from an Item.
 * 
 * @author Peter NGO, Guillaume POUSSEL and Mathieu RUL
 * 
 * @version 1.0
 */
public class Video extends Item {

	/**
	 * Director of the Video.
	 */
	String director;
	
	/**
	 * Length of the Video.
	 */
	double length;

	/**
	 * Constructor of the {@code class}. Create a Video from an ID.
	 * 
	 * @param ID
	 *            the Video ID.
	 */
	public Video(Integer ID) {
		super(ID);
		setType("Video");
	}

	/**
	 * Constructor of the {@code class}. Create a Video from parameter.
	 * 
	 * @param ID
	 *            the Video ID.
	 * 
	 * @param title
	 *            the Video title.
	 *            
	 * @param tags
	 *            the Video tags.
	 *            
	 * @param comments
	 *            the Video comments.
	 *            
	 * @param director
	 *            the Video director.
	 *            
	 * @param length
	 *            the Video length.
	 */
	public Video(Integer ID, String title, HashSet<Integer> tags,
			HashSet<Integer> comments, String director, double length) {
		super(ID, "Video", title, tags, comments);
		this.director = director;
		this.length = length;

	}

	/**
	 * Returns a {@code String} array with the allowed MIME types for a Video.
	 * 
	 * @return a string array with the allowed MIME.
	 */
	@Override
	public String[] allowedMimeTypes() {
		return new String[] { "video/mpeg", "video/mp4", "video/quicktime",
				"video/x-ms-wmv", "video/x-msvideo" };
	}

	/**
	 * Get the director of the Video.
	 * 
	 * @return the director.
	 */
	public String getDirector() {
		return director;
	}

	/**
	 * Get the length of the Video.
	 * 
	 * @return the length.
	 */
	public double getLength() {
		return length;
	}

	/**
	 * Set the director of the Video.
	 * 
	 * @param director
	 *            the director to set.
	 */
	public void setDirector(String director) {
		this.director = director;
	}

	/**
	 * Set the length of the Video.
	 * 
	 * @param length
	 *            the length to set.
	 */
	public void setLength(double length) {
		this.length = length;
	}

	/**
	 * Returns a {@code String} object representing the Video's value.
	 * 
	 * @return a string representation of the Video.
	 */
	@Override
	public String toString() {
		return super.toString() + "\nDirector: " + director + "\nLength: "
				+ length + " min";
	}

}
